package com.workcell.workdata.im.model.dto;

import com.workcell.workdata.im.util.JSON;
import org.apache.commons.lang3.StringUtils;

import java.util.Set;

public class MessageTitle {

    private Long qt;

    private String name;

    private Boolean atAll;

    private Set<Long> at;

    private Set<Long> robotAt ;

    public Long getQt() {
        return qt;
    }

    public void setQt(Long qt) {
        this.qt = qt;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getAtAll() {
        return atAll;
    }

    public void setAtAll(Boolean atAll) {
        this.atAll = atAll;
    }

    public Set<Long> getAt() {
        return at;
    }

    public void setAt(Set<Long> at) {
        this.at = at;
    }

    public Set<Long> getRobotAt() {
        return robotAt;
    }

    public void setRobotAt(Set<Long> robotAt) {
        this.robotAt = robotAt;
    }

    public static MessageTitle of(String title){
        if (StringUtils.isEmpty(title)){
            return new MessageTitle();
        }

        return JSON.parse(title,MessageTitle.class);
    }

    @Override
    public String toString(){
        return JSON.toJSONString(this);
    }
}
